/**
 * Created by tz on 2019/1/4.
 */
import client from '../helper/client';
export default {
    root: '/api/students',
    getList(params) {
        return client({
            method: 'GET',
            path: this.root,
            params:params
        });
    },
    getOne(id) {
        return client({
            method: 'GET',
            path: '/api/students/'+id,
        });
    },
    deleteOne(id) {
        return client({
            method: 'DELETE',
            path: '/api/students/'+id,
        });
    },
    updateOne(entity){
        return client({
            method: 'PUT',
            path: '/api/students',
            entity:entity
        });
    },
    addOne(entity){
        return client({
            method: 'POST',
            path: '/api/students',
            entity:entity
        });
    },
    addScoreHistory(entity){
        return client({
            method: 'POST',
            path: '/api/score-histories',
            entity:entity
        });
    },
    getByLogin(login) {
        return client({
            method: 'GET',
            path: '/api/students-by-login/'+login,
        });
    },
}